(function(/*! Brunch !*/) {
  'use strict';

  var globals = typeof window !== 'undefined' ? window : global;
  if (typeof globals.require === 'function') return;

  var modules = {};
  var cache = {};

  var has = function(object, name) {
    return hasOwnProperty.call(object, name);
  };

  var expand = function(root, name) {
    var results = [], parts, part;
    if (/^\.\.?(\/|$)/.test(name)) {
      parts = [root, name].join('/').split('/');
    } else {
      parts = name.split('/');
    }
    for (var i = 0, length = parts.length; i < length; i++) {
      part = parts[i];
      if (part === '..') {
        results.pop();
      } else if (part !== '.' && part !== '') {
        results.push(part);
      }
    }
    return results.join('/');
  };

  var dirname = function(path) {
    return path.split('/').slice(0, -1).join('/');
  };

  var localRequire = function(path) {
    return function(name) {
      var dir = dirname(path);
      var absolute = expand(dir, name);
      return require(absolute);
    };
  };

  var initModule = function(name, definition) {
    var module = {id: name, exports: {}};
    definition(module.exports, localRequire(name), module);
    var exports = cache[name] = module.exports;
    return exports;
  };

  var require = function(name) {
    var path = expand(name, '.');

    if (has(cache, path)) return cache[path];
    if (has(modules, path)) return initModule(path, modules[path]);

    var dirIndex = expand(path, './index');
    if (has(cache, dirIndex)) return cache[dirIndex];
    if (has(modules, dirIndex)) return initModule(dirIndex, modules[dirIndex]);

    throw new Error('Cannot find module "' + name + '"');
  };

  var define = function(bundle) {
    for (var key in bundle) {
      if (has(bundle, key)) {
        modules[key] = bundle[key];
      }
    }
  }

  globals.require = require;
  globals.require.define = define;
  globals.require.brunch = true;
})();

window.require.define({"application": function(exports, require, module) {
  var Application, Chaplin, HeaderController, Layout, NavigationController, SessionController, mediator, routes,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Chaplin = require('chaplin');

  mediator = require('mediator');

  routes = require('routes');

  SessionController = require('controllers/session_controller');

  HeaderController = require('controllers/header_controller');

  NavigationController = require('controllers/navigation_controller');

  Layout = require('views/layout');

  module.exports = Application = (function(_super) {

    __extends(Application, _super);

    function Application() {
      return Application.__super__.constructor.apply(this, arguments);
    }

    Application.prototype.title = 'Ost.io';

    Application.prototype.initialize = function() {
      Application.__super__.initialize.apply(this, arguments);
      this.initDispatcher();
      this.initLayout();
      this.initMediator();
      this.initControllers();
      this.initRouter(routes);
      return typeof Object.freeze === "function" ? Object.freeze(this) : void 0;
    };

    Application.prototype.initLayout = function() {
      return this.layout = new Layout({
        title: this.title
      });
    };

    Application.prototype.initControllers = function() {
      new SessionController();
      new HeaderController();
      return new NavigationController();
    };

    Application.prototype.initMediator = function() {
      Chaplin.mediator.user = null;
      return Chaplin.mediator.seal();
    };

    return Application;

  })(Chaplin.Application);
  
}});

window.require.define({"config": function(exports, require, module) {
  var config, production;

  config = {
    api: {}
  };

  production = true;

  config.api.root = production ? 'http://api.ost.io' : 'http://dev.ost.io:3000';

  config.api.versionRoot = config.api.root + '/v1';

  module.exports = config;
  
}});

window.require.define({"config": function(exports, require, module) {
  (function() {
    var config, production;

    config = {
      api: {}
    };

    production = true;

    config.api.root = production ? 'http://api.ost.io' : 'http://dev.ost.io:3000';

    config.api.versionRoot = config.api.root + '/v1';

    module.exports = config;

  }).call(this);
  
}});

window.require.define({"controllers/auth_controller": function(exports, require, module) {
  var AuthController, Controller, mediator,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  mediator = require('mediator');

  Controller = require('controllers/base/controller');

  module.exports = AuthController = (function(_super) {

    __extends(AuthController, _super);

    function AuthController() {
      return AuthController.__super__.constructor.apply(this, arguments);
    }

    AuthController.prototype.historyURL = 'auth';

    AuthController.prototype.callback = function(params) {
      console.log('AuthController');
      localStorage.setItem('accessToken', params.accessToken);
      this.redirectTo("/" + params.login);
      return window.location.reload();
    };

    AuthController.prototype.logout = function() {
      this.redirectTo('/');
      localStorage.clear();
      return mediator.publish('!logout');
    };

    return AuthController;

  })(Controller);
  
}});

window.require.define({"controllers/base/controller": function(exports, require, module) {
  var Chaplin, Controller,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Chaplin = require('chaplin');

  module.exports = Controller = (function(_super) {

    __extends(Controller, _super);

    function Controller() {
      return Controller.__super__.constructor.apply(this, arguments);
    }

    return Controller;

  })(Chaplin.Controller);
  
}});

window.require.define({"controllers/feed_controller": function(exports, require, module) {
  var Controller, FeedController, FeedPageView,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Controller = require('controllers/base/controller');

  FeedPageView = require('views/feed_page_view');

  module.exports = FeedController = (function(_super) {

    __extends(FeedController, _super);

    function FeedController() {
      return FeedController.__super__.constructor.apply(this, arguments);
    }

    FeedController.prototype.historyURL = 'feed';

    FeedController.prototype.show = function(params) {
      return this.view = new FeedPageView();
    };

    return FeedController;

  })(Controller);
  
}});

window.require.define({"controllers/feed_controller": function(exports, require, module) {
  (function() {
    var Controller, FeedController, FeedPageView,
      __hasProp = {}.hasOwnProperty,
      __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };

    Controller = require('controllers/base/controller');

    FeedPageView = require('views/feed_page_view');

    module.exports = FeedController = (function(_super) {

      __extends(FeedController, _super);

      FeedController.name = 'FeedController';

      function FeedController() {
        return FeedController.__super__.constructor.apply(this, arguments);
      }

      FeedController.prototype.historyURL = 'feed';

      FeedController.prototype.show = function(params) {
        return this.view = new FeedPageView();
      };

      return FeedController;

    })(Controller);

  }).call(this);
  
}});

window.require.define({"controllers/header_controller": function(exports, require, module) {
  var Controller, Header, HeaderController, HeaderView, mediator,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Controller = require('controllers/base/controller');

  mediator = require('mediator');

  Header = require('models/header');

  HeaderView = require('views/header_view');

  module.exports = HeaderController = (function(_super) {

    __extends(HeaderController, _super);

    function HeaderController() {
      return HeaderController.__super__.constructor.apply(this, arguments);
    }

    HeaderController.prototype.initialize = function() {
      HeaderController.__super__.initialize.apply(this, arguments);
      this.model = new Header();
      return this.view = new HeaderView({
        model: this.model
      });
    };

    return HeaderController;

  })(Controller);
  
}});

window.require.define({"controllers/home_controller": function(exports, require, module) {
  var Controller, HomeController, HomePageView,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Controller = require('controllers/base/controller');

  HomePageView = require('views/home_page_view');

  module.exports = HomeController = (function(_super) {

    __extends(HomeController, _super);

    function HomeController() {
      return HomeController.__super__.constructor.apply(this, arguments);
    }

    HomeController.prototype.historyURL = '';

    HomeController.prototype.show = function(params) {
      return this.view = new HomePageView();
    };

    return HomeController;

  })(Controller);
  
}});

window.require.define({"controllers/navigation_controller": function(exports, require, module) {
  var Controller, Navigation, NavigationController, NavigationView,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Controller = require('controllers/base/controller');

  Navigation = require('models/navigation');

  NavigationView = require('views/navigation_view');

  module.exports = NavigationController = (function(_super) {

    __extends(NavigationController, _super);

    function NavigationController() {
      return NavigationController.__super__.constructor.apply(this, arguments);
    }

    NavigationController.prototype.initialize = function() {
      NavigationController.__super__.initialize.apply(this, arguments);
      this.model = new Navigation();
      return this.view = new NavigationView({
        model: this.model
      });
    };

    return NavigationController;

  })(Controller);
  
}});

window.require.define({"controllers/posts_controller": function(exports, require, module) {
  var Controller, Post, PostView, PostsController,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Controller = require('controllers/base/controller');

  Post = require('models/post');

  PostView = require('views/post_view');

  module.exports = PostsController = (function(_super) {

    __extends(PostsController, _super);

    function PostsController() {
      return PostsController.__super__.constructor.apply(this, arguments);
    }

    PostsController.prototype.historyURL = 'posts';

    PostsController.prototype.show = function(params) {
      this.model = new Post();
      this.view = new PostView({
        model: this.model
      });
      return this.model.fetch();
    };

    return PostsController;

  })(Controller);
  
}});

window.require.define({"controllers/repos_controller": function(exports, require, module) {
  var Controller, Repo, RepoPageView, ReposController, User,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Controller = require('controllers/base/controller');

  Repo = require('models/repo');

  RepoPageView = require('views/repo_page_view');

  User = require('models/user');

  module.exports = ReposController = (function(_super) {

    __extends(ReposController, _super);

    function ReposController() {
      return ReposController.__super__.constructor.apply(this, arguments);
    }

    ReposController.prototype.historyURL = 'repos';

    ReposController.prototype.show = function(params) {
      var user;
      user = new User({
        login: params.login
      });
      this.model = new Repo({
        user: user,
        name: params.repoName
      });
      this.view = new RepoPageView({
        model: this.model
      });
      return this.model.fetch();
    };

    return ReposController;

  })(Controller);
  
}});

window.require.define({"controllers/session_controller": function(exports, require, module) {
  var Controller, LoginView, Ostio, SessionController, User, mediator,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  mediator = require('mediator');

  Controller = require('controllers/base/controller');

  User = require('models/user');

  LoginView = require('views/login_view');

  Ostio = require('lib/services/ostio');

  module.exports = SessionController = (function(_super) {

    __extends(SessionController, _super);

    function SessionController() {
      this.logout = __bind(this.logout, this);

      this.serviceProviderSession = __bind(this.serviceProviderSession, this);

      this.triggerLogin = __bind(this.triggerLogin, this);
      return SessionController.__super__.constructor.apply(this, arguments);
    }

    SessionController.serviceProviders = {
      ostio: new Ostio()
    };

    SessionController.prototype.loginStatusDetermined = false;

    SessionController.prototype.loginView = null;

    SessionController.prototype.serviceProviderName = null;

    SessionController.prototype.initialize = function() {
      this.subscribeEvent('serviceProviderSession', this.serviceProviderSession);
      this.subscribeEvent('logout', this.logout);
      this.subscribeEvent('userData', this.userData);
      this.subscribeEvent('!showLogin', this.showLoginView);
      this.subscribeEvent('!login', this.triggerLogin);
      this.subscribeEvent('!logout', this.triggerLogout);
      return this.getSession();
    };

    SessionController.prototype.loadServiceProviders = function() {
      var name, serviceProvider, _ref, _results;
      _ref = SessionController.serviceProviders;
      _results = [];
      for (name in _ref) {
        serviceProvider = _ref[name];
        _results.push(serviceProvider.load());
      }
      return _results;
    };

    SessionController.prototype.createUser = function(userData) {
      return mediator.user = new User(userData);
    };

    SessionController.prototype.getSession = function() {
      var name, serviceProvider, _ref, _results;
      this.loadServiceProviders();
      _ref = SessionController.serviceProviders;
      _results = [];
      for (name in _ref) {
        serviceProvider = _ref[name];
        _results.push(serviceProvider.done(serviceProvider.getLoginStatus));
      }
      return _results;
    };

    SessionController.prototype.showLoginView = function() {
      if (this.loginView) {
        return;
      }
      this.loadServiceProviders();
      return this.loginView = new LoginView({
        serviceProviders: SessionController.serviceProviders
      });
    };

    SessionController.prototype.triggerLogin = function(serviceProviderName) {
      var serviceProvider;
      serviceProvider = SessionController.serviceProviders[serviceProviderName];
      if (!serviceProvider.isLoaded()) {
        mediator.publish('serviceProviderMissing', serviceProviderName);
        return;
      }
      mediator.publish('loginAttempt', serviceProviderName);
      return serviceProvider.triggerLogin();
    };

    SessionController.prototype.serviceProviderSession = function(session) {
      this.serviceProviderName = session.provider.name;
      this.disposeLoginView();
      session.id = session.userId;
      delete session.userId;
      this.createUser(session);
      return this.publishLogin();
    };

    SessionController.prototype.publishLogin = function() {
      this.loginStatusDetermined = true;
      mediator.publish('login', mediator.user);
      return mediator.publish('loginStatus', true);
    };

    SessionController.prototype.triggerLogout = function() {
      return mediator.publish('logout');
    };

    SessionController.prototype.logout = function() {
      this.loginStatusDetermined = true;
      this.disposeUser();
      this.serviceProviderName = null;
      this.showLoginView();
      return mediator.publish('loginStatus', false);
    };

    SessionController.prototype.userData = function(data) {
      return mediator.user.set(data);
    };

    SessionController.prototype.disposeLoginView = function() {
      if (!this.loginView) {
        return;
      }
      this.loginView.dispose();
      return this.loginView = null;
    };

    SessionController.prototype.disposeUser = function() {
      if (!mediator.user) {
        return;
      }
      mediator.user.dispose();
      return mediator.user = null;
    };

    return SessionController;

  })(Controller);
  
}});

window.require.define({"controllers/topics_controller": function(exports, require, module) {
  var Controller, Repo, Topic, TopicPageView, TopicsController, User,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Controller = require('controllers/base/controller');

  Topic = require('models/topic');

  TopicPageView = require('views/topic_page_view');

  User = require('models/user');

  Repo = require('models/repo');

  module.exports = TopicsController = (function(_super) {

    __extends(TopicsController, _super);

    function TopicsController() {
      return TopicsController.__super__.constructor.apply(this, arguments);
    }

    TopicsController.prototype.historyURL = 'topics';

    TopicsController.prototype.redirect_to_repo = function(params) {
      return Backbone.history.navigate("/" + params.login + "/" + params.repoName);
    };

    TopicsController.prototype.show = function(params) {
      var repo, user;
      user = new User({
        login: params.login
      });
      repo = new Repo({
        user: user,
        name: params.repoName
      });
      this.model = new Topic({
        repo: repo,
        number: params.topicNumber
      });
      this.view = new TopicPageView({
        model: this.model
      });
      return this.model.fetch();
    };

    return TopicsController;

  })(Controller);
  
}});

window.require.define({"controllers/users_controller": function(exports, require, module) {
  var Controller, User, UserPageView, UsersController,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Controller = require('controllers/base/controller');

  User = require('models/user');

  UserPageView = require('views/user_page_view');

  module.exports = UsersController = (function(_super) {

    __extends(UsersController, _super);

    function UsersController() {
      return UsersController.__super__.constructor.apply(this, arguments);
    }

    UsersController.prototype.historyURL = 'users';

    UsersController.prototype.show = function(params) {
      this.model = new User({
        login: params.login
      });
      this.view = new UserPageView({
        model: this.model
      });
      return this.model.fetch();
    };

    return UsersController;

  })(Controller);
  
}});

window.require.define({"initialize": function(exports, require, module) {
  var Application;

  Application = require('application');

  $(function() {
    var app;
    app = new Application();
    return app.initialize();
  });
  
}});

window.require.define({"lib/services/ostio": function(exports, require, module) {
  var Ostio, ServiceProvider, config, mediator,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  config = require('config');

  mediator = require('mediator');

  ServiceProvider = require('lib/services/service_provider');

  module.exports = Ostio = (function(_super) {

    __extends(Ostio, _super);

    Ostio.prototype.baseUrl = config.api.root;

    function Ostio() {
      this.loginStatusHandler = __bind(this.loginStatusHandler, this);

      this.loginHandler = __bind(this.loginHandler, this);

      var authCallback;
      Ostio.__super__.constructor.apply(this, arguments);
      this.accessToken = localStorage.getItem('accessToken');
      authCallback = _(this.loginHandler).bind(this, this.loginHandler);
      mediator.subscribe('auth:callback:ostio', authCallback);
    }

    Ostio.prototype.load = function() {
      this.resolve();
      return this;
    };

    Ostio.prototype.isLoaded = function() {
      return true;
    };

    Ostio.prototype.ajax = function(type, url, data) {
      url = this.baseUrl + url;
      if (this.accessToken) {
        url += "?access_token=" + this.accessToken;
      }
      return $.ajax({
        url: url,
        data: data,
        type: type,
        dataType: 'json'
      });
    };

    Ostio.prototype.triggerLogin = function(loginContext) {
      var callback;
      callback = _(this.loginHandler).bind(this, this.loginHandler);
      return window.location = URL;
    };

    Ostio.prototype.loginHandler = function(loginContext, response) {
      if (response) {
        mediator.publish('loginSuccessful', {
          provider: this,
          loginContext: loginContext
        });
        this.accessToken = response.accessToken;
        localStorage.setItem('accessToken', this.accessToken);
        return this.getUserData().done(this.processUserData);
      } else {
        return mediator.publish('loginFail', {
          provider: this,
          loginContext: loginContext
        });
      }
    };

    Ostio.prototype.getUserData = function() {
      return this.ajax('get', '/v1/users/me');
    };

    Ostio.prototype.processUserData = function(response) {
      return mediator.publish('userData', response);
    };

    Ostio.prototype.getLoginStatus = function(callback, force) {
      if (callback == null) {
        callback = this.loginStatusHandler;
      }
      if (force == null) {
        force = false;
      }
      return this.getUserData().always(callback);
    };

    Ostio.prototype.loginStatusHandler = function(response, status) {
      if (!response || status === 'error') {
        return mediator.publish('logout');
      } else {
        return mediator.publish('serviceProviderSession', _.extend(response, {
          provider: this,
          userId: response.id,
          accessToken: this.accessToken
        }));
      }
    };

    return Ostio;

  })(ServiceProvider);
  
}});

window.require.define({"lib/services/service_provider": function(exports, require, module) {
  var Chaplin, ServiceProvider, utils;

  utils = require('lib/utils');

  Chaplin = require('chaplin');

  module.exports = ServiceProvider = (function() {

    _(ServiceProvider.prototype).extend(Chaplin.Subscriber);

    ServiceProvider.prototype.loading = false;

    function ServiceProvider() {
      /*console.debug 'ServiceProvider#constructor'
      */
      _(this).extend($.Deferred());
      utils.deferMethods({
        deferred: this,
        methods: ['triggerLogin', 'getLoginStatus'],
        onDeferral: this.load
      });
    }

    ServiceProvider.prototype.disposed = false;

    ServiceProvider.prototype.dispose = function() {
      /*console.debug 'ServiceProvider#dispose'
      */
      if (this.disposed) {
        return;
      }
      this.unsubscribeAllEvents();
      this.disposed = true;
      return typeof Object.freeze === "function" ? Object.freeze(this) : void 0;
    };

    return ServiceProvider;

  })();

  /*

    Standard methods and their signatures:

    load: ->
      # Load a script like this:
      utils.loadLib 'http://example.org/foo.js', @loadHandler, @reject

    loadHandler: =>
      # Init the library, then resolve
      ServiceProviderLibrary.init(foo: 'bar')
      @resolve()

    isLoaded: ->
      # Return a Boolean
      Boolean window.ServiceProviderLibrary and ServiceProviderLibrary.login

    # Trigger login popup
    triggerLogin: (loginContext) ->
      callback = _(@loginHandler).bind(this, loginContext)
      ServiceProviderLibrary.login callback

    # Callback for the login popup
    loginHandler: (loginContext, response) =>

      eventPayload = {provider: this, loginContext}
      if response
        # Publish successful login
        mediator.publish 'loginSuccessful', eventPayload

        # Publish the session
        mediator.publish 'serviceProviderSession',
          provider: this
          userId: response.userId
          accessToken: response.accessToken
          # etc.

      else
        mediator.publish 'loginFail', eventPayload

    getLoginStatus: (callback = @loginStatusHandler, force = false) ->
      ServiceProviderLibrary.getLoginStatus callback, force

    loginStatusHandler: (response) =>
      return unless response
      mediator.publish 'serviceProviderSession',
        provider: this
        userId: response.userId
        accessToken: response.accessToken
        # etc.
  */

  
}});

window.require.define({"lib/support": function(exports, require, module) {
  var Chaplin, support, utils;

  utils = require('lib/utils');

  Chaplin = require('chaplin');

  support = utils.beget(Chaplin.support);

  module.exports = support;
  
}});

window.require.define({"lib/utils": function(exports, require, module) {
  var Chaplin, mediator, utils,
    __hasProp = {}.hasOwnProperty;

  Chaplin = require('chaplin');

  mediator = require('mediator');

  utils = Chaplin.utils.beget(Chaplin.utils);

  _(utils).extend({
    /*
      Wrap methods so they can be called before a deferred is resolved.
      The actual methods are called once the deferred is resolved.
    
      Parameters:
    
      Expects an options hash with the following properties:
    
      deferred
        The Deferred object to wait for.
    
      methods
        Either:
        - A string with a method name e.g. 'method'
        - An array of strings e.g. ['method1', 'method2']
        - An object with methods e.g. {method: -> alert('resolved!')}
    
      host (optional)
        If you pass an array of strings in the `methods` parameter the methods
        are fetched from this object. Defaults to `deferred`.
    
      target (optional)
        The target object the new wrapper methods are created at.
        Defaults to host if host is given, otherwise it defaults to deferred.
    
      onDeferral (optional)
        An additional callback function which is invoked when the method is called
        and the Deferred isn't resolved yet.
        After the method is registered as a done handler on the Deferred,
        this callback is invoked. This can be used to trigger the resolving
        of the Deferred.
    
      Examples:
    
      deferMethods(deferred: def, methods: 'foo')
        Wrap the method named foo of the given deferred def and
        postpone all calls until the deferred is resolved.
    
      deferMethods(deferred: def, methods: def.specialMethods)
        Read all methods from the hash def.specialMethods and
        create wrapped methods with the same names at def.
    
      deferMethods(
        deferred: def, methods: def.specialMethods, target: def.specialMethods
      )
        Read all methods from the object def.specialMethods and
        create wrapped methods at def.specialMethods,
        overwriting the existing ones.
    
      deferMethods(deferred: def, host: obj, methods: ['foo', 'bar'])
        Wrap the methods obj.foo and obj.bar so all calls to them are postponed
        until def is resolved. obj.foo and obj.bar are overwritten
        with their wrappers.
    */

    deferMethods: function(options) {
      var deferred, func, host, methods, methodsHash, name, onDeferral, target, _i, _len, _results;
      deferred = options.deferred;
      methods = options.methods;
      host = options.host || deferred;
      target = options.target || host;
      onDeferral = options.onDeferral;
      methodsHash = {};
      if (typeof methods === 'string') {
        methodsHash[methods] = host[methods];
      } else if (methods.length && methods[0]) {
        for (_i = 0, _len = methods.length; _i < _len; _i++) {
          name = methods[_i];
          func = host[name];
          if (typeof func !== 'function') {
            throw new TypeError("utils.deferMethods: method " + name + " notfound on host " + host);
          }
          methodsHash[name] = func;
        }
      } else {
        methodsHash = methods;
      }
      _results = [];
      for (name in methodsHash) {
        if (!__hasProp.call(methodsHash, name)) continue;
        func = methodsHash[name];
        if (typeof func !== 'function') {
          continue;
        }
        _results.push(target[name] = utils.createDeferredFunction(deferred, func, target, onDeferral));
      }
      return _results;
    },
    createDeferredFunction: function(deferred, func, context, onDeferral) {
      if (context == null) {
        context = deferred;
      }
      return function() {
        var args;
        args = arguments;
        if (deferred.state() === 'resolved') {
          return func.apply(context, args);
        } else {
          deferred.done(function() {
            return func.apply(context, args);
          });
          if (typeof onDeferral === 'function') {
            return onDeferral.apply(context);
          }
        }
      };
    }
  });

  module.exports = utils;
  
}});

window.require.define({"lib/view_helper": function(exports, require, module) {
  var config, mediator, unescape, unescapeTags, utils,
    __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

  config = require('config');

  mediator = require('mediator');

  utils = require('lib/utils');

  Handlebars.registerHelper('if_logged_in', function(options) {
    if (mediator.user) {
      return options.fn(this);
    } else {
      return options.inverse(this);
    }
  });

  Handlebars.registerHelper('if_has_sync_repo_permission', function(options) {
    var organizations, user, _ref;
    user = mediator.user;
    if (!user) {
      return options.inverse(this);
    }
    organizations = _(user.get('organizations')).map(function(org) {
      return org.login;
    });
    if (user.get('login') === this.login || (_ref = this.login, __indexOf.call(organizations, _ref) >= 0)) {
      return options.fn(this);
    } else {
      return options.inverse(this);
    }
  });

  Handlebars.registerHelper('if_user_type_is_user', function(options) {
    var _ref;
    if (((_ref = mediator.user) != null ? _ref.get('type') : void 0) === 'User') {
      return options.fn(this);
    } else {
      return options.inverse(this);
    }
  });

  Handlebars.registerHelper('if_on_mac', function(options) {
    if (/mac/i.test(navigator.userAgent)) {
      return options.fn(this);
    } else {
      return options.inverse(this);
    }
  });

  Handlebars.registerHelper('with', function(context, options) {
    if (!context || Handlebars.Utils.isEmpty(context)) {
      return options.inverse(this);
    } else {
      return options.fn(context);
    }
  });

  Handlebars.registerHelper('without', function(context, options) {
    var inverse;
    inverse = options.inverse;
    options.inverse = options.fn;
    options.fn = inverse;
    return Handlebars.helpers["with"].call(this, context, options);
  });

  Handlebars.registerHelper('with_config', function(options) {
    var context;
    context = config;
    return Handlebars.helpers["with"].call(this, context, options);
  });

  Handlebars.registerHelper('with_user', function(options) {
    var context;
    context = mediator.user.getAttributes();
    return Handlebars.helpers["with"].call(this, context, options);
  });

  Handlebars.registerHelper('gravatar', function(options) {
    return "https://secure.gravatar.com/avatar/" + (options.fn(this)) + "?s=140&d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png";
  });

  Handlebars.registerHelper('date', function(options) {
    var date;
    date = new Date(options.fn(this));
    return new Handlebars.SafeString(moment(date).fromNow());
  });

  unescape = function(string, re, replacements) {
    return string.replace(re, function(substr, index) {
      return replacements[substr];
    });
  };

  unescapeTags = function(string) {
    var re, replacements;
    re = /&(?:amp|#x27|#x60|quot);/g;
    replacements = {
      '&amp;': '&',
      '&#x27;': '\'',
      '&quot;': '"',
      '&#x60;': '`'
    };
    return unescape(string, re, replacements);
  };

  Handlebars.registerHelper('markdown', function(options) {
    var markdown, unescaped;
    unescaped = unescapeTags(options.fn(this)).replace(/@([\w\.]+)/, '[**@$1**](/$1)');
    markdown = marked(unescaped, {
      gfm: true,
      highlight: function(code, language) {
        var result;
        result = language ? hljs.highlight(language, code).value : code;
        return unescapeTags(result);
      }
    });
    return new Handlebars.SafeString(markdown);
  });
  
}});

window.require.define({"mediator": function(exports, require, module) {
  
  module.exports = require('chaplin').mediator;
  
}});

window.require.define({"models/base/collection": function(exports, require, module) {
  var ChaplinCollection, Collection, Model,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  ChaplinCollection = require('chaplin/models/collection');

  Model = require('models/base/model');

  module.exports = Collection = (function(_super) {

    __extends(Collection, _super);

    function Collection() {
      return Collection.__super__.constructor.apply(this, arguments);
    }

    Collection.prototype.model = Model;

    Collection.prototype.initialize = function(models, options) {
      if ((options != null ? options.url : void 0) != null) {
        this.url = options.url;
      }
      return Collection.__super__.initialize.apply(this, arguments);
    };

    Collection.prototype.urlPath = function() {
      return "/users/" + this.urlParams.login + "/repos/" + this.urlParams.repoName + "/topics/" + this.urlParams.topicNumber + "/posts/";
    };

    return Collection;

  })(ChaplinCollection);
  
}});

window.require.define({"models/base/model": function(exports, require, module) {
  var ChaplinModel, Model, config, mediator,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  mediator = require('mediator');

  ChaplinModel = require('chaplin/models/model');

  config = require('config');

  module.exports = Model = (function(_super) {

    __extends(Model, _super);

    function Model() {
      return Model.__super__.constructor.apply(this, arguments);
    }

    Model.prototype.apiRoot = config.api.versionRoot;

    Model.prototype.urlKey = 'id';

    Model.prototype.urlPath = function() {
      return '';
    };

    Model.prototype.urlParams = function() {
      var _ref;
      return {
        access_token: (_ref = mediator.user) != null ? _ref.get('accessToken') : void 0
      };
    };

    Model.prototype.urlRoot = function() {
      var urlPath;
      urlPath = this.urlPath();
      if (urlPath) {
        return this.apiRoot + urlPath;
      } else if (this.collection) {
        return this.collection.url();
      } else {
        throw new Error('Model must redefine urlPath');
      }
    };

    Model.prototype.url = function(data) {
      var base, full, params, payload, sep, url;
      if (data == null) {
        data = '';
      }
      base = this.urlRoot();
      full = this.get(this.urlKey) != null ? base + encodeURIComponent(this.get(this.urlKey)) + data : base + data;
      sep = full.indexOf('?') >= 0 ? '&' : '?';
      params = this.urlParams();
      payload = _.keys(params).map(function(key) {
        return [key, params[key]];
      }).filter(function(pair) {
        return pair[1] != null;
      }).map(function(pair) {
        return pair.join('=');
      }).join('&');
      url = payload ? full + sep + payload : full;
      return url;
    };

    Model.prototype.fetch = function(options) {
      var _this = this;
      this.trigger('loadStart');
      (options != null ? options : options = {}).success = function() {
        return _this.trigger('load');
      };
      return Model.__super__.fetch.apply(this, arguments);
    };

    return Model;

  })(ChaplinModel);
  
}});

window.require.define({"models/feed": function(exports, require, module) {
  var Feed, Model,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Model = require('models/base/model');

  module.exports = Feed = (function(_super) {

    __extends(Feed, _super);

    function Feed() {
      return Feed.__super__.constructor.apply(this, arguments);
    }

    return Feed;

  })(Model);
  
}});

window.require.define({"models/header": function(exports, require, module) {
  var Header, Model,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Model = require('models/base/model');

  module.exports = Header = (function(_super) {

    __extends(Header, _super);

    function Header() {
      return Header.__super__.constructor.apply(this, arguments);
    }

    return Header;

  })(Model);
  
}});

window.require.define({"models/navigation": function(exports, require, module) {
  var Model, Navigation,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Model = require('models/base/model');

  module.exports = Navigation = (function(_super) {

    __extends(Navigation, _super);

    function Navigation() {
      return Navigation.__super__.constructor.apply(this, arguments);
    }

    return Navigation;

  })(Model);
  
}});

window.require.define({"models/post": function(exports, require, module) {
  var Model, Post, Repo, Topic, User,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Model = require('models/base/model');

  User = require('models/user');

  Repo = require('models/repo');

  Topic = require('models/topic');

  module.exports = Post = (function(_super) {

    __extends(Post, _super);

    function Post() {
      return Post.__super__.constructor.apply(this, arguments);
    }

    Post.prototype.urlPath = function() {
      return "/users/" + (this.get('topic').get('repo').get('user').get('login')) + "/repos/" + (this.get('topic').get('repo').get('name')) + "/topics/" + (this.get('topic').get('number')) + "/posts/";
    };

    Post.prototype.parse = function(response) {
      var repo, repoUser, topic, user;
      repoUser = new User(_.extend(response.topic.repo.user, {}));
      repo = new Repo(_.extend(response.topic.repo, {
        user: repoUser
      }));
      topic = new Topic(_.extend(response.topic, {
        repo: repo
      }));
      user = new User(_.extend(response.user, {}));
      return _.extend(response, {
        topic: topic
      });
    };

    Post.prototype.setUrl = function() {
      var url;
      url = "/" + (this.get('topic').get('repo').get('user').get('login')) + "/" + (this.get('topic').get('repo').get('name')) + "/topics/" + (this.get('topic').get('number'));
      return this.set({
        url: url
      });
    };

    return Post;

  })(Model);
  
}});

window.require.define({"models/repo": function(exports, require, module) {
  var Model, Repo, User,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Model = require('models/base/model');

  User = require('models/user');

  module.exports = Repo = (function(_super) {

    __extends(Repo, _super);

    function Repo() {
      return Repo.__super__.constructor.apply(this, arguments);
    }

    Repo.prototype.urlKey = 'name';

    Repo.prototype.urlPath = function() {
      return "/users/" + (this.get('user').get('login')) + "/repos/";
    };

    Repo.prototype.parse = function(response) {
      var user;
      user = new User(_.extend(response.user, {}));
      return _.extend(response, {
        user: user
      });
    };

    return Repo;

  })(Model);
  
}});

window.require.define({"models/topic": function(exports, require, module) {
  var Model, Repo, Topic, User,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Model = require('models/base/model');

  User = require('models/user');

  Repo = require('models/repo');

  module.exports = Topic = (function(_super) {

    __extends(Topic, _super);

    function Topic() {
      return Topic.__super__.constructor.apply(this, arguments);
    }

    Topic.prototype.urlKey = 'number';

    Topic.prototype.urlPath = function() {
      return "/users/" + (this.get('repo').get('user').get('login')) + "/repos/" + (this.get('repo').get('name')) + "/topics/";
    };

    Topic.prototype.parse = function(response) {
      var Post, repo, user;
      Post = require('models/post');
      user = new User(_.extend(response.repo.user, {}));
      repo = new Repo(_.extend(response.repo, {
        user: user
      }));
      return _.extend(response, {
        repo: repo
      });
    };

    return Topic;

  })(Model);
  
}});

window.require.define({"models/user": function(exports, require, module) {
  var Model, User,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Model = require('models/base/model');

  module.exports = User = (function(_super) {

    __extends(User, _super);

    function User() {
      return User.__super__.constructor.apply(this, arguments);
    }

    User.prototype.urlKey = 'login';

    User.prototype.urlPath = function() {
      return '/users/';
    };

    return User;

  })(Model);
  
}});

window.require.define({"routes": function(exports, require, module) {
  
  module.exports = function(match) {
    match('', 'home#show');
    match('logout/', 'auth#logout');
    match('feed/', 'feed#show');
    match(':login', 'users#show');
    match(':login/:repoName', 'repos#show');
    match(':login/:repoName/', 'topics#redirect_to_repo');
    match(':login/:repoName/topics', 'topics#redirect_to_repo');
    match(':login/:repoName/topics/', 'topics#redirect_to_repo');
    match(':login/:repoName/topics/:topicNumber', 'topics#show');
    return match('auth-callback/?login=:login&accessToken=:accessToken', 'auth#callback');
  };
  
}});

window.require.define({"views/base/collection_view": function(exports, require, module) {
  var Chaplin, CollectionView, View,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Chaplin = require('chaplin');

  View = require('views/base/view');

  module.exports = CollectionView = (function(_super) {

    __extends(CollectionView, _super);

    function CollectionView() {
      return CollectionView.__super__.constructor.apply(this, arguments);
    }

    CollectionView.prototype.getTemplateFunction = View.prototype.getTemplateFunction;

    CollectionView.prototype.useCssAnimation = true;

    return CollectionView;

  })(Chaplin.CollectionView);
  
}});

window.require.define({"views/base/page_view": function(exports, require, module) {
  var PageView, View, mediator,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  mediator = require('mediator');

  View = require('views/base/view');

  module.exports = PageView = (function(_super) {

    __extends(PageView, _super);

    function PageView() {
      return PageView.__super__.constructor.apply(this, arguments);
    }

    PageView.prototype.renderedSubviews = false;

    PageView.prototype.container = '#content-container';

    PageView.prototype.initialize = function() {
      var rendered,
        _this = this;
      PageView.__super__.initialize.apply(this, arguments);
      if (this.model || this.collection) {
        rendered = false;
        return this.modelBind('change', function() {
          if (!rendered) {
            _this.render();
          }
          return rendered = true;
        });
      }
    };

    PageView.prototype.getNavigationData = function() {
      return {};
    };

    PageView.prototype.renderSubviews = function() {};

    PageView.prototype.render = function() {
      PageView.__super__.render.apply(this, arguments);
      if (!this.renderedSubviews) {
        this.renderSubviews();
        this.renderedSubviews = true;
      }
      return mediator.publish('navigation:change', this.getNavigationData());
    };

    return PageView;

  })(View);
  
}});

window.require.define({"views/base/view": function(exports, require, module) {
  var ChaplinView, View, utils,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  ChaplinView = require('chaplin/views/view');

  utils = require('lib/utils');

  require('lib/view_helper');

  module.exports = View = (function(_super) {

    __extends(View, _super);

    function View() {
      return View.__super__.constructor.apply(this, arguments);
    }

    View.prototype.initialize = function() {
      return View.__super__.initialize.apply(this, arguments);
    };

    View.prototype.getTemplateData = function() {
      var Model, modelAttributes, serialize, templateData;
      Model = require('models/base/model');
      serialize = function(object) {
        var key, result, value;
        result = {};
        for (key in object) {
          value = object[key];
          result[key] = value instanceof Model ? serialize(value.getAttributes()) : value;
        }
        return result;
      };
      modelAttributes = this.model && this.model.getAttributes();
      templateData = modelAttributes ? utils.beget(serialize(modelAttributes)) : {};
      if (this.model && typeof this.model.state === 'function') {
        templateData.resolved = this.model.state() === 'resolved';
      }
      return templateData;
    };

    View.prototype.getTemplateFunction = function() {
      return this.template;
    };

    return View;

  })(ChaplinView);
  
}});

window.require.define({"views/feed_page_view": function(exports, require, module) {
  var Collection, FeedPageView, FeedPostsView, PageView, Post, User, UsersView, config, template,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  PageView = require('views/base/page_view');

  template = require('views/templates/feed_page');

  config = require('config');

  Collection = require('models/base/collection');

  Post = require('models/post');

  FeedPostsView = require('views/feed_posts_view');

  User = require('models/user');

  UsersView = require('views/users_view');

  module.exports = FeedPageView = (function(_super) {

    __extends(FeedPageView, _super);

    function FeedPageView() {
      return FeedPageView.__super__.constructor.apply(this, arguments);
    }

    FeedPageView.prototype.template = template;

    FeedPageView.prototype.autoRender = true;

    FeedPageView.prototype.renderSubviews = function() {
      var posts, users;
      users = new Collection(null, {
        model: User
      });
      users.url = "" + config.api.versionRoot + "/users/";
      this.subview('users', new UsersView({
        collection: users,
        container: this.$('.user-list-container')
      }));
      users.fetch();
      posts = new Collection(null, {
        model: Post
      });
      posts.url = "" + config.api.versionRoot + "/posts/";
      this.subview('posts', new FeedPostsView({
        collection: posts,
        container: this.$('.post-list-container')
      }));
      return posts.fetch();
    };

    return FeedPageView;

  })(PageView);
  
}});

window.require.define({"views/feed_post_view": function(exports, require, module) {
  var FeedPostView, PostView,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  PostView = require('views/base/view');

  module.exports = FeedPostView = (function(_super) {

    __extends(FeedPostView, _super);

    function FeedPostView() {
      return FeedPostView.__super__.constructor.apply(this, arguments);
    }

    FeedPostView.prototype.template = require('views/templates/post');

    FeedPostView.prototype.initialize = function() {
      FeedPostView.__super__.initialize.apply(this, arguments);
      return this.model.setUrl();
    };

    return FeedPostView;

  })(PostView);
  
}});

window.require.define({"views/feed_posts_view": function(exports, require, module) {
  var FeedPostView, FeedPostsView, PostsView,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  PostsView = require('views/posts_view');

  FeedPostView = require('views/feed_post_view');

  module.exports = FeedPostsView = (function(_super) {

    __extends(FeedPostsView, _super);

    function FeedPostsView() {
      return FeedPostsView.__super__.constructor.apply(this, arguments);
    }

    FeedPostsView.prototype.itemView = FeedPostView;

    return FeedPostsView;

  })(PostsView);
  
}});

window.require.define({"views/form_view": function(exports, require, module) {
  var FormView, SpinnerView, View, mediator,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  mediator = require('mediator');

  View = require('views/base/view');

  SpinnerView = require('views/spinner_view');

  module.exports = FormView = (function(_super) {

    __extends(FormView, _super);

    function FormView() {
      this.save = __bind(this.save, this);
      return FormView.__super__.constructor.apply(this, arguments);
    }

    FormView.prototype.tagName = 'form';

    FormView.prototype.autoRender = true;

    FormView.prototype.initialize = function() {
      var _this = this;
      FormView.__super__.initialize.apply(this, arguments);
      this.subscribeEvent('loginStatus', this.render);
      return this.delegate('submit', function(event) {
        event.preventDefault();
        if (event.currentTarget.checkValidity()) {
          return _this.save(event);
        }
      });
    };

    FormView.prototype.publishSave = function(response) {
      if (this.saveEvent) {
        return mediator.publish(this.saveEvent, response);
      }
    };

    FormView.prototype.save = function(event) {
      var spinner,
        _this = this;
      spinner = new SpinnerView({
        container: this.$('.submit-form')
      });
      return this.model.save().done(function(response) {
        _this.publishSave(response);
        _this.trigger('dispose');
        return _this.dispose();
      }).fail(function(response) {
        return spinner.dispose();
      });
    };

    return FormView;

  })(View);
  
}});

window.require.define({"views/header_view": function(exports, require, module) {
  var HeaderView, View, mediator, template,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  mediator = require('mediator');

  View = require('views/base/view');

  template = require('views/templates/header');

  module.exports = HeaderView = (function(_super) {

    __extends(HeaderView, _super);

    function HeaderView() {
      return HeaderView.__super__.constructor.apply(this, arguments);
    }

    HeaderView.prototype.template = template;

    HeaderView.prototype.tagName = 'header';

    HeaderView.prototype.id = 'header';

    HeaderView.prototype.className = 'header';

    HeaderView.prototype.container = '#header-container';

    HeaderView.prototype.autoRender = true;

    HeaderView.prototype.initialize = function() {
      HeaderView.__super__.initialize.apply(this, arguments);
      this.subscribeEvent('loginStatus', this.render);
      return this.subscribeEvent('startupController', this.render);
    };

    return HeaderView;

  })(View);
  
}});

window.require.define({"views/home_page_view": function(exports, require, module) {
  var HomePageView, PageView, template,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  PageView = require('views/base/page_view');

  template = require('views/templates/home_page');

  module.exports = HomePageView = (function(_super) {

    __extends(HomePageView, _super);

    function HomePageView() {
      return HomePageView.__super__.constructor.apply(this, arguments);
    }

    HomePageView.prototype.template = template;

    HomePageView.prototype.autoRender = true;

    return HomePageView;

  })(PageView);
  
}});

window.require.define({"views/layout": function(exports, require, module) {
  var Chaplin, Layout,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Chaplin = require('chaplin');

  module.exports = Layout = (function(_super) {

    __extends(Layout, _super);

    function Layout() {
      return Layout.__super__.constructor.apply(this, arguments);
    }

    return Layout;

  })(Chaplin.Layout);
  
}});

window.require.define({"views/login_view": function(exports, require, module) {
  var LoginView, View, mediator, template, utils,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  mediator = require('mediator');

  utils = require('lib/utils');

  View = require('views/base/view');

  template = require('views/templates/login');

  module.exports = LoginView = (function(_super) {

    __extends(LoginView, _super);

    function LoginView() {
      return LoginView.__super__.constructor.apply(this, arguments);
    }

    LoginView.prototype.template = template;

    LoginView.prototype.id = 'login';

    LoginView.prototype.container = '#content-container';

    LoginView.prototype.autoRender = true;

    LoginView.prototype.initialize = function(options) {
      LoginView.__super__.initialize.apply(this, arguments);
      return this.initButtons(options.serviceProviders);
    };

    LoginView.prototype.initButtons = function(serviceProviders) {
      var buttonSelector, failed, loaded, loginHandler, serviceProvider, serviceProviderName, _results;
      _results = [];
      for (serviceProviderName in serviceProviders) {
        serviceProvider = serviceProviders[serviceProviderName];
        buttonSelector = "." + serviceProviderName;
        this.$(buttonSelector).addClass('service-loading');
        loginHandler = _(this.loginWith).bind(this, serviceProviderName, serviceProvider);
        this.delegate('click', buttonSelector, loginHandler);
        loaded = _(this.serviceProviderLoaded).bind(this, serviceProviderName, serviceProvider);
        serviceProvider.done(loaded);
        failed = _(this.serviceProviderFailed).bind(this, serviceProviderName, serviceProvider);
        _results.push(serviceProvider.fail(failed));
      }
      return _results;
    };

    LoginView.prototype.loginWith = function(serviceProviderName, serviceProvider, e) {
      e.preventDefault();
      if (!serviceProvider.isLoaded()) {
        return;
      }
      mediator.publish('login:pickService', serviceProviderName);
      return mediator.publish('!login', serviceProviderName);
    };

    LoginView.prototype.serviceProviderLoaded = function(serviceProviderName) {
      return this.$("." + serviceProviderName).removeClass('service-loading');
    };

    LoginView.prototype.serviceProviderFailed = function(serviceProviderName) {
      return this.$("." + serviceProviderName).removeClass('service-loading').addClass('service-unavailable').attr('disabled', true).attr('title', "Error connecting. Please check whether you areblocking " + (utils.upcase(serviceProviderName)) + ".");
    };

    return LoginView;

  })(View);
  
}});

window.require.define({"views/navigation_view": function(exports, require, module) {
  var NavigationView, View, template,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  View = require('views/base/view');

  template = require('views/templates/navigation');

  module.exports = NavigationView = (function(_super) {

    __extends(NavigationView, _super);

    function NavigationView() {
      return NavigationView.__super__.constructor.apply(this, arguments);
    }

    NavigationView.prototype.template = template;

    NavigationView.prototype.tagName = 'nav';

    NavigationView.prototype.className = 'navigation';

    NavigationView.prototype.container = '#navigation-container';

    NavigationView.prototype.initialize = function() {
      var _this = this;
      NavigationView.__super__.initialize.apply(this, arguments);
      this.modelBind('change', this.render);
      return this.subscribeEvent('navigation:change', function(attributes) {
        _this.model.clear({
          silent: true
        });
        return _this.model.set(attributes);
      });
    };

    return NavigationView;

  })(View);
  
}});

window.require.define({"views/new_post_form_view": function(exports, require, module) {
  var FormView, NewPostFormView, template,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  FormView = require('views/form_view');

  template = require('views/templates/new_post_form');

  module.exports = NewPostFormView = (function(_super) {

    __extends(NewPostFormView, _super);

    function NewPostFormView() {
      this.changeText = __bind(this.changeText, this);
      return NewPostFormView.__super__.constructor.apply(this, arguments);
    }

    NewPostFormView.prototype.template = template;

    NewPostFormView.prototype.className = 'topic-post topic-post-create';

    NewPostFormView.prototype.saveEvent = 'post:new';

    NewPostFormView.prototype.initialize = function() {
      NewPostFormView.__super__.initialize.apply(this, arguments);
      this.pass('text', '.topic-new-post-body');
      return this.delegate('keyup keydown', '.topic-new-post-body', this.changeText);
    };

    NewPostFormView.prototype.changeText = function(event) {
      if (event.metaKey && event.keyCode === 13) {
        return this.$el.trigger('submit');
      } else {
        return this.model.set({
          text: $(event.currentTarget).val()
        });
      }
    };

    return NewPostFormView;

  })(FormView);
  
}});

window.require.define({"views/new_topic_form_view": function(exports, require, module) {
  var FormView, NewTopicFormView, Post, SpinnerView, template,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  FormView = require('views/form_view');

  template = require('views/templates/new_topic_form');

  Post = require('models/post');

  SpinnerView = require('views/spinner_view');

  module.exports = NewTopicFormView = (function(_super) {

    __extends(NewTopicFormView, _super);

    function NewTopicFormView() {
      this.save = __bind(this.save, this);

      this.changeText = __bind(this.changeText, this);

      this.changeTitle = __bind(this.changeTitle, this);

      this.toggleFields = __bind(this.toggleFields, this);
      return NewTopicFormView.__super__.constructor.apply(this, arguments);
    }

    NewTopicFormView.prototype.template = template;

    NewTopicFormView.prototype.className = 'new-topic-form';

    NewTopicFormView.prototype.saveEvent = 'topic:new';

    NewTopicFormView.prototype.initialize = function() {
      NewTopicFormView.__super__.initialize.apply(this, arguments);
      this.post = new Post({
        topic: this.model
      });
      this.delegate('click', '.new-topic-form-toggle-fields-button', this.toggleFields);
      this.delegate('keyup keydown', '.new-topic-form-title', this.changeTitle);
      return this.delegate('keyup keydown', '.new-topic-form-text', this.changeText);
    };

    NewTopicFormView.prototype.toggleFields = function(event) {
      $(event.currentTarget).toggleClass('active');
      return this.$('.new-topic-form-fields').toggleClass('visible');
    };

    NewTopicFormView.prototype.changeTitle = function(event) {
      if (!event.currentTarget.validity.valid) {
        return;
      }
      if (event.metaKey && event.keyCode === 13) {
        return this.$el.trigger('submit');
      } else {
        return this.model.set({
          title: $(event.currentTarget).val()
        });
      }
    };

    NewTopicFormView.prototype.changeText = function(event) {
      if (!event.currentTarget.validity.valid) {
        return;
      }
      if (event.metaKey && event.keyCode === 13) {
        return this.$el.trigger('submit');
      } else {
        return this.post.set({
          text: $(event.currentTarget).val()
        });
      }
    };

    NewTopicFormView.prototype.save = function(event) {
      var spinner,
        _this = this;
      spinner = new SpinnerView({
        container: this.$('.submit-form')
      });
      return this.model.save().done(function(response) {
        return _this.post.save().done(function(postResponse) {
          _this.$('.new-topic-form-toggle-fields-button').click();
          return setTimeout(function() {
            _this.publishSave(response);
            _this.trigger('dispose');
            return _this.dispose();
          }, 300);
        }).fail(function(error) {
          console.error('NewTopicFormView#save', error);
          return _this.model.destroy();
        }).always(function() {
          return spinner.dispose();
        });
      }).fail(function() {
        return spinner.dispose();
      });
    };

    return NewTopicFormView;

  })(FormView);
  
}});

window.require.define({"views/organization_owners_view": function(exports, require, module) {
  var OrganizationOwnersView, UsersView, template,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  UsersView = require('views/users_view');

  template = require('views/templates/organization_owners');

  module.exports = OrganizationOwnersView = (function(_super) {

    __extends(OrganizationOwnersView, _super);

    function OrganizationOwnersView() {
      return OrganizationOwnersView.__super__.constructor.apply(this, arguments);
    }

    OrganizationOwnersView.prototype.template = template;

    OrganizationOwnersView.prototype.listSelector = '.users-list';

    return OrganizationOwnersView;

  })(UsersView);
  
}});

window.require.define({"views/post_view": function(exports, require, module) {
  var PostView, View, template,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  View = require('views/base/view');

  template = require('views/templates/post');

  module.exports = PostView = (function(_super) {

    __extends(PostView, _super);

    function PostView() {
      return PostView.__super__.constructor.apply(this, arguments);
    }

    PostView.prototype.template = template;

    PostView.prototype.className = 'post topic-post';

    PostView.prototype.tagName = 'article';

    return PostView;

  })(View);
  
}});

window.require.define({"views/posts_view": function(exports, require, module) {
  var CollectionView, Post, PostsView,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  CollectionView = require('views/base/collection_view');

  Post = require('views/post_view');

  module.exports = PostsView = (function(_super) {

    __extends(PostsView, _super);

    function PostsView() {
      return PostsView.__super__.constructor.apply(this, arguments);
    }

    PostsView.prototype.className = 'topic-posts';

    PostsView.prototype.itemView = Post;

    return PostsView;

  })(CollectionView);
  
}});

window.require.define({"views/repo_page_view": function(exports, require, module) {
  var Collection, NewTopicFormView, PageView, RepoPageView, Topic, TopicsView, template,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  PageView = require('views/base/page_view');

  template = require('views/templates/repo_page');

  Collection = require('models/base/collection');

  Topic = require('models/topic');

  NewTopicFormView = require('views/new_topic_form_view');

  TopicsView = require('views/topics_view');

  module.exports = RepoPageView = (function(_super) {

    __extends(RepoPageView, _super);

    function RepoPageView() {
      return RepoPageView.__super__.constructor.apply(this, arguments);
    }

    RepoPageView.prototype.template = template;

    RepoPageView.prototype.getNavigationData = function() {
      return {
        gravatar_id: this.model.get('user').get('gravatar_id'),
        user_login: this.model.get('user').get('login'),
        repo_name: this.model.get('name')
      };
    };

    RepoPageView.prototype.renderSubviews = function() {
      var createNewTopic, topics,
        _this = this;
      topics = new Collection(null, {
        model: Topic
      });
      topics.url = this.model.url('/topics/');
      this.subview('topics', new TopicsView({
        collection: topics,
        container: this.$('.repo-topic-list-container')
      }));
      topics.fetch();
      this.subscribeEvent('topic:new', function(topic) {
        return topics.unshift(topic);
      });
      createNewTopic = function() {
        var newTopic, newTopicView;
        newTopic = new Topic({
          repo: _this.model
        });
        newTopicView = new NewTopicFormView({
          model: newTopic,
          container: _this.$('.new-topic-form-container')
        });
        newTopicView.on('dispose', function() {
          return setTimeout(createNewTopic, 0);
        });
        return _this.subview('newTopicForm', newTopicView);
      };
      return createNewTopic();
    };

    return RepoPageView;

  })(PageView);
  
}});

window.require.define({"views/repo_view": function(exports, require, module) {
  var RepoView, View, template,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  View = require('views/base/view');

  template = require('views/templates/repo');

  module.exports = RepoView = (function(_super) {

    __extends(RepoView, _super);

    function RepoView() {
      return RepoView.__super__.constructor.apply(this, arguments);
    }

    RepoView.prototype.template = template;

    RepoView.prototype.tagName = 'li';

    RepoView.prototype.className = 'user-repo';

    return RepoView;

  })(View);
  
}});

window.require.define({"views/repos_view": function(exports, require, module) {
  var CollectionView, Repo, ReposView,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  CollectionView = require('views/base/collection_view');

  Repo = require('views/repo_view');

  module.exports = ReposView = (function(_super) {

    __extends(ReposView, _super);

    function ReposView() {
      return ReposView.__super__.constructor.apply(this, arguments);
    }

    ReposView.prototype.tagName = 'ul';

    ReposView.prototype.className = 'user-repo-list';

    ReposView.prototype.itemView = Repo;

    return ReposView;

  })(CollectionView);
  
}});

window.require.define({"views/spinner_view": function(exports, require, module) {
  var SpinnerView, View, template,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  View = require('views/base/view');

  template = require('views/templates/spinner');

  module.exports = SpinnerView = (function(_super) {

    __extends(SpinnerView, _super);

    function SpinnerView() {
      return SpinnerView.__super__.constructor.apply(this, arguments);
    }

    SpinnerView.prototype.template = template;

    SpinnerView.prototype.containerMethod = 'html';

    SpinnerView.prototype.autoRender = true;

    SpinnerView.prototype.initialize = function(options) {
      SpinnerView.__super__.initialize.apply(this, arguments);
      return this.previous = options.container.html();
    };

    SpinnerView.prototype.dispose = function() {
      $(this.container).html(this.previous);
      return SpinnerView.__super__.dispose.apply(this, arguments);
    };

    return SpinnerView;

  })(View);
  
}});

window.require.define({"views/templates/feed_page": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var foundHelper, self=this;


    return "<div class=\"user-list-container\">\n  <h4>Latest users</h4>\n</div>\n\n<div class=\"post-list-container\">\n  <h4>Latest posts</h4>\n</div>\n";});
}});

window.require.define({"views/templates/header": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var buffer = "", stack1, foundHelper, tmp1, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing;

  function program1(depth0,data) {
    
    var buffer = "", stack1;
    buffer += "\n    ";
    foundHelper = helpers.with_user;
    stack1 = foundHelper || depth0.with_user;
    tmp1 = self.program(2, program2, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "\n  ";
    return buffer;}
  function program2(depth0,data) {
    
    var buffer = "", stack1;
    buffer += "\n      <a href=\"/";
    foundHelper = helpers.login;
    stack1 = foundHelper || depth0.login;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\"><img class=\"avatar header-avatar\" src=\"";
    foundHelper = helpers.gravatar;
    stack1 = foundHelper || depth0.gravatar;
    tmp1 = self.program(3, program3, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "\"></a>\n      <a href=\"/";
    foundHelper = helpers.login;
    stack1 = foundHelper || depth0.login;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\">";
    foundHelper = helpers.login;
    stack1 = foundHelper || depth0.login;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "</a>\n      <a class=\"icon-logout\" href=\"/logout/\"></a>\n    ";
    return buffer;}
  function program3(depth0,data) {
    
    var stack1;
    foundHelper = helpers.gravatar_id;
    stack1 = foundHelper || depth0.gravatar_id;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "gravatar_id", { hash: {} }); }
    return escapeExpression(stack1);}

  function program5(depth0,data) {
    
    var buffer = "", stack1;
    buffer += "\n    ";
    foundHelper = helpers.with_config;
    stack1 = foundHelper || depth0.with_config;
    tmp1 = self.program(6, program6, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "\n  ";
    return buffer;}
  function program6(depth0,data) {
    
    var buffer = "", stack1;
    buffer += "\n      <button class=\"header-login-button button go-to\" data-href=\"";
    foundHelper = helpers.api;
    stack1 = foundHelper || depth0.api;
    stack1 = (stack1 === null || stack1 === undefined || stack1 === false ? stack1 : stack1.root);
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "api.root", { hash: {} }); }
    buffer += escapeExpression(stack1) + "/auth/github\">Login with GitHub</button>\n    ";
    return buffer;}

    buffer += "<h1 class=\"header-logo\">\n  <a href=\"/\">Ost.io</a>\n</h1>\n\n<div class=\"header-links\">\n  <h4 class=\"header-link\"><a href=\"/feed/\">News feed</a></h4>\n</div>\n\n<div class=\"header-auth\">\n  ";
    foundHelper = helpers.if_logged_in;
    stack1 = foundHelper || depth0.if_logged_in;
    tmp1 = self.program(1, program1, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.program(5, program5, data);
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "\n</div>\n";
    return buffer;});
}});

window.require.define({"views/templates/home_page": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var foundHelper, self=this;


    return "<h2>Your open source talks place</h2>\n<p>Ost.io (\"open-source talks\") is a forum for open-source projects and the best place for discussing project stuff with other users. It is tightly integrated with <a href=\"https://github.com/\">GitHub</a>.</p>\n\n<p>The main ost.io mission is to replace mailing lists. <strong>Mailing lists are broken!</strong>. They have ugly interface, most of the time you can't read all messages in a comfortable way (instead, you see a plain-text message). Unfortunately, a lot of open-source projects currently still use mailing lists, because there was no replacement for it. Until now.</p>\n\n<p>To start, click on \"Sign in with GitHub\" button at the top. You'll be redirected to your account then. If you want to sync your repositories, press the button on your profile or profile of any of your organization. When logged in, you're able to create any thread &amp; post in any repo.</p>\n\n<p>This project is open-source and available on GitHub: (<a href=\"https://github.com/paulmillr/ostio/\">frontend</a>, <a href=\"https://github.com/paulmillr/ostio-api/\">backend</a>). Oh, and there's also <a href=\"https://github.com/paulmillr/ostio-api#api\">API documentation</a>. Follow <a href=\"http://twitter.com/paulmillr\">@paulmillr</a> on twitter to get latest updates.</p>\n\n<h3>Users</h3>\n\n<p>Some popular open-source projects are already using ost.io.\nCare to join them? You're three clicks away!</p>\n\n<ul>\n  <li><a href=\"/chaplinjs/chaplin\">Chaplin</a> — app framework on top of Backbone.js.</li>\n\n  <li><a href=\"/brunch/brunch\">Brunch</a> — lightweight build tool for HTML5 apps.</li>\n\n  <li><a href=\"/gkz/LiveScript\">LiveScript</a> — more functional-programming oriented CoffeeScript fork.</li>\n</ul>\n\n<a class=\"screenshot-container\" href=\"/paulmillr\">\n  <img class=\"screenshot\" src=\"http://brunch.io/images/screenshots/ostio.png\" alt=\"screenshot\" />\n</a>\n";});
}});

window.require.define({"views/templates/login": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var buffer = "", foundHelper, self=this;


    return buffer;});
}});

window.require.define({"views/templates/navigation": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var buffer = "", stack1, stack2, foundHelper, tmp1, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing;

  function program1(depth0,data) {
    
    var buffer = "", stack1, stack2;
    buffer += "\n  <h2>\n    <a class=\"navigation-link\" href=\"/";
    foundHelper = helpers.user_login;
    stack1 = foundHelper || depth0.user_login;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "user_login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\">\n      <img class=\"avatar\" src=\"";
    foundHelper = helpers.gravatar;
    stack1 = foundHelper || depth0.gravatar;
    tmp1 = self.program(2, program2, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "\" alt=\"\" />\n    </a>\n    <a class=\"navigation-link\" href=\"/";
    foundHelper = helpers.user_login;
    stack1 = foundHelper || depth0.user_login;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "user_login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\">";
    foundHelper = helpers.user_login;
    stack1 = foundHelper || depth0.user_login;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "user_login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "</a>\n    ";
    foundHelper = helpers.repo_name;
    stack1 = foundHelper || depth0.repo_name;
    stack2 = helpers['if'];
    tmp1 = self.program(4, program4, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    stack1 = stack2.call(depth0, stack1, tmp1);
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "\n  </h2>\n";
    return buffer;}
  function program2(depth0,data) {
    
    var stack1;
    foundHelper = helpers.gravatar_id;
    stack1 = foundHelper || depth0.gravatar_id;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "gravatar_id", { hash: {} }); }
    return escapeExpression(stack1);}

  function program4(depth0,data) {
    
    var buffer = "", stack1, stack2;
    buffer += "\n      / <a class=\"navigation-link\" href=\"/";
    foundHelper = helpers.user_login;
    stack1 = foundHelper || depth0.user_login;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "user_login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "/";
    foundHelper = helpers.repo_name;
    stack1 = foundHelper || depth0.repo_name;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "repo_name", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\">";
    foundHelper = helpers.repo_name;
    stack1 = foundHelper || depth0.repo_name;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "repo_name", { hash: {} }); }
    buffer += escapeExpression(stack1) + "</a>\n      ";
    foundHelper = helpers.topic_number;
    stack1 = foundHelper || depth0.topic_number;
    stack2 = helpers['if'];
    tmp1 = self.program(5, program5, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    stack1 = stack2.call(depth0, stack1, tmp1);
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "\n    ";
    return buffer;}
  function program5(depth0,data) {
    
    var buffer = "", stack1;
    buffer += "\n        / <a class=\"navigation-link\" href=\"/";
    foundHelper = helpers.user_login;
    stack1 = foundHelper || depth0.user_login;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "user_login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "/";
    foundHelper = helpers.repo_name;
    stack1 = foundHelper || depth0.repo_name;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "repo_name", { hash: {} }); }
    buffer += escapeExpression(stack1) + "/topics/";
    foundHelper = helpers.topic_number;
    stack1 = foundHelper || depth0.topic_number;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "topic_number", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\">#";
    foundHelper = helpers.topic_number;
    stack1 = foundHelper || depth0.topic_number;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "topic_number", { hash: {} }); }
    buffer += escapeExpression(stack1) + "</a>\n      ";
    return buffer;}

    foundHelper = helpers.user_login;
    stack1 = foundHelper || depth0.user_login;
    stack2 = helpers['if'];
    tmp1 = self.program(1, program1, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    stack1 = stack2.call(depth0, stack1, tmp1);
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "\n";
    return buffer;});
}});

window.require.define({"views/templates/new_post_form": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var stack1, foundHelper, tmp1, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing;

  function program1(depth0,data) {
    
    var buffer = "", stack1;
    buffer += "\n  ";
    foundHelper = helpers.with_user;
    stack1 = foundHelper || depth0.with_user;
    tmp1 = self.program(2, program2, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "\n";
    return buffer;}
  function program2(depth0,data) {
    
    var buffer = "", stack1;
    buffer += "\n  <div class=\"topic-post-avatar-container\">\n    <img class=\"topic-post-avatar avatar\" src=\"";
    foundHelper = helpers.gravatar;
    stack1 = foundHelper || depth0.gravatar;
    tmp1 = self.program(3, program3, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "\" alt=\"\" />\n  </div>\n  <div class=\"topic-post-content\">\n    <div class=\"topic-post-header\">\n      <a class=\"topic-post-author\" href=\"/";
    foundHelper = helpers.login;
    stack1 = foundHelper || depth0.login;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\">";
    foundHelper = helpers.login;
    stack1 = foundHelper || depth0.login;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "</a>      \n      <em class=\"topic-post-metadata\">Posts are parsed with <a href=\"http://github.github.com/github-flavored-markdown/\" class=\"gfm-help\">Markdown</a></em>\n    </div>\n    <div class=\"topic-post-text\">\n      <textarea class=\"topic-new-post-body\" required></textarea>\n      <button class=\"topic-new-post-create-button submit-form button\">Comment on this topic";
    foundHelper = helpers.if_on_mac;
    stack1 = foundHelper || depth0.if_on_mac;
    tmp1 = self.program(5, program5, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "</button>\n    </div>\n  </div>\n  ";
    return buffer;}
  function program3(depth0,data) {
    
    var stack1;
    foundHelper = helpers.gravatar_id;
    stack1 = foundHelper || depth0.gravatar_id;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "gravatar_id", { hash: {} }); }
    return escapeExpression(stack1);}

  function program5(depth0,data) {
    
    
    return " (⌘↩)";}

  function program7(depth0,data) {
    
    
    return "\n  <p>You must be logged in to comment</p>\n";}

    foundHelper = helpers.if_logged_in;
    stack1 = foundHelper || depth0.if_logged_in;
    tmp1 = self.program(1, program1, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.program(7, program7, data);
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { return stack1; }
    else { return ''; }});
}});

window.require.define({"views/templates/new_topic_form": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var stack1, foundHelper, tmp1, self=this, functionType="function", blockHelperMissing=helpers.blockHelperMissing;

  function program1(depth0,data) {
    
    var buffer = "", stack1;
    buffer += "\n  <div class=\"new-topic-form-toggle-fields-button-container\">\n    <input type=\"button\" class=\"button new-topic-form-toggle-fields-button\" value=\"Create new topic\" />\n  </div>\n\n  <div class=\"new-topic-form-fields\">\n    <input class=\"new-topic-form-title\" type=\"text\" name=\"new-topic-form-title\" value=\"\" placeholder=\"Title\" required>\n    <textarea class=\"new-topic-form-text\" placeholder=\"Post body\" required></textarea>\n    <div class=\"new-topic-form-submit-button-container form-submit-button-container\">\n      <button class=\"new-topic-form-submit-button submit-form button\">\n        Submit new topic";
    foundHelper = helpers.if_on_mac;
    stack1 = foundHelper || depth0.if_on_mac;
    tmp1 = self.program(2, program2, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "\n      </button>\n    </div>\n  </div>\n";
    return buffer;}
  function program2(depth0,data) {
    
    
    return " (⌘↩)";}

    foundHelper = helpers.if_logged_in;
    stack1 = foundHelper || depth0.if_logged_in;
    tmp1 = self.program(1, program1, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { return stack1; }
    else { return ''; }});
}});

window.require.define({"views/templates/organization_owners": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var foundHelper, self=this;


    return "<h4>Owners</h4>\n<div class=\"users-list\"></div>\n";});
}});

window.require.define({"views/templates/post": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var buffer = "", stack1, stack2, foundHelper, tmp1, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing;

  function program1(depth0,data) {
    
    var stack1;
    foundHelper = helpers.user;
    stack1 = foundHelper || depth0.user;
    stack1 = (stack1 === null || stack1 === undefined || stack1 === false ? stack1 : stack1.gravatar_id);
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "user.gravatar_id", { hash: {} }); }
    return escapeExpression(stack1);}

  function program3(depth0,data) {
    
    var buffer = "", stack1;
    buffer += "in <a class=\"topic-post-url\" href=\"";
    foundHelper = helpers.url;
    stack1 = foundHelper || depth0.url;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "url", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\">";
    foundHelper = helpers.url;
    stack1 = foundHelper || depth0.url;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "url", { hash: {} }); }
    buffer += escapeExpression(stack1) + "</a>";
    return buffer;}

  function program5(depth0,data) {
    
    var stack1;
    foundHelper = helpers.created_at;
    stack1 = foundHelper || depth0.created_at;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "created_at", { hash: {} }); }
    return escapeExpression(stack1);}

  function program7(depth0,data) {
    
    var stack1;
    foundHelper = helpers.text;
    stack1 = foundHelper || depth0.text;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "text", { hash: {} }); }
    return escapeExpression(stack1);}

    buffer += "<a class=\"topic-post-avatar-container\" href=\"/";
    foundHelper = helpers.user;
    stack1 = foundHelper || depth0.user;
    stack1 = (stack1 === null || stack1 === undefined || stack1 === false ? stack1 : stack1.login);
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "user.login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\">\n  <img class=\"topic-post-avatar avatar\" src=\"";
    foundHelper = helpers.gravatar;
    stack1 = foundHelper || depth0.gravatar;
    tmp1 = self.program(1, program1, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "\" alt=\"\" />\n</a>\n<div class=\"topic-post-content\">\n  <div class=\"topic-post-header\">\n    <a class=\"topic-post-author\" href=\"/";
    foundHelper = helpers.user;
    stack1 = foundHelper || depth0.user;
    stack1 = (stack1 === null || stack1 === undefined || stack1 === false ? stack1 : stack1.login);
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "user.login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\">";
    foundHelper = helpers.user;
    stack1 = foundHelper || depth0.user;
    stack1 = (stack1 === null || stack1 === undefined || stack1 === false ? stack1 : stack1.login);
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "user.login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "</a>\n    ";
    foundHelper = helpers.url;
    stack1 = foundHelper || depth0.url;
    stack2 = helpers['if'];
    tmp1 = self.program(3, program3, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    stack1 = stack2.call(depth0, stack1, tmp1);
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "\n    <time class=\"topic-post-metadata topic-post-date\">";
    foundHelper = helpers.date;
    stack1 = foundHelper || depth0.date;
    tmp1 = self.program(5, program5, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "</time>\n  </div>\n  <div class=\"topic-post-text\">\n    ";
    foundHelper = helpers.markdown;
    stack1 = foundHelper || depth0.markdown;
    tmp1 = self.program(7, program7, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "\n  </div>\n</div>\n";
    return buffer;});
}});

window.require.define({"views/templates/repo": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var buffer = "", stack1, foundHelper, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression;


    buffer += "<a href=\"/";
    foundHelper = helpers.user;
    stack1 = foundHelper || depth0.user;
    stack1 = (stack1 === null || stack1 === undefined || stack1 === false ? stack1 : stack1.login);
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "user.login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "/";
    foundHelper = helpers.name;
    stack1 = foundHelper || depth0.name;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\">\n  ";
    foundHelper = helpers.name;
    stack1 = foundHelper || depth0.name;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\n</a>\n";
    return buffer;});
}});

window.require.define({"views/templates/repo_page": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var foundHelper, self=this;


    return "<div class=\"new-topic-form-container\"></div>\n<div class=\"repo-topic-list-container\">\n  <h4>Topics</h4>\n</div>\n";});
}});

window.require.define({"views/templates/spinner": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var foundHelper, self=this;


    return "<img class=\"spinner\" src=\"/images/spinner.gif\" />\n";});
}});

window.require.define({"views/templates/topic": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var buffer = "", stack1, foundHelper, tmp1, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing;

  function program1(depth0,data) {
    
    var stack1;
    foundHelper = helpers.created_at;
    stack1 = foundHelper || depth0.created_at;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "created_at", { hash: {} }); }
    return escapeExpression(stack1);}

    buffer += "<div class=\"repo-topic-header\">\n  <a href=\"";
    foundHelper = helpers.repo;
    stack1 = foundHelper || depth0.repo;
    stack1 = (stack1 === null || stack1 === undefined || stack1 === false ? stack1 : stack1.name);
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "repo.name", { hash: {} }); }
    buffer += escapeExpression(stack1) + "/topics/";
    foundHelper = helpers.number;
    stack1 = foundHelper || depth0.number;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "number", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\">#";
    foundHelper = helpers.number;
    stack1 = foundHelper || depth0.number;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "number", { hash: {} }); }
    buffer += escapeExpression(stack1) + "</a>\n  <a href=\"";
    foundHelper = helpers.repo;
    stack1 = foundHelper || depth0.repo;
    stack1 = (stack1 === null || stack1 === undefined || stack1 === false ? stack1 : stack1.name);
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "repo.name", { hash: {} }); }
    buffer += escapeExpression(stack1) + "/topics/";
    foundHelper = helpers.number;
    stack1 = foundHelper || depth0.number;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "number", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\">";
    foundHelper = helpers.title;
    stack1 = foundHelper || depth0.title;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "title", { hash: {} }); }
    buffer += escapeExpression(stack1) + "</a>\n</div>\nby <a class=\"topic-post-author\" href=\"/";
    foundHelper = helpers.user;
    stack1 = foundHelper || depth0.user;
    stack1 = (stack1 === null || stack1 === undefined || stack1 === false ? stack1 : stack1.login);
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "user.login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\">";
    foundHelper = helpers.user;
    stack1 = foundHelper || depth0.user;
    stack1 = (stack1 === null || stack1 === undefined || stack1 === false ? stack1 : stack1.login);
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "user.login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "</a>\n<time class=\"\">";
    foundHelper = helpers.date;
    stack1 = foundHelper || depth0.date;
    tmp1 = self.program(1, program1, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "</time>\n<span class=\"topic-post-metadata topic-post-date\">";
    foundHelper = helpers.total_posts;
    stack1 = foundHelper || depth0.total_posts;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "total_posts", { hash: {} }); }
    buffer += escapeExpression(stack1) + " posts</span>\n";
    return buffer;});
}});

window.require.define({"views/templates/topic_page": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var foundHelper, self=this;


    return "<div class=\"topic-posts-container\"></div>\n<div class=\"new-post-form-container\"></div>\n";});
}});

window.require.define({"views/templates/user": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var buffer = "", stack1, foundHelper, tmp1, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing;

  function program1(depth0,data) {
    
    var stack1;
    foundHelper = helpers.gravatar_id;
    stack1 = foundHelper || depth0.gravatar_id;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "gravatar_id", { hash: {} }); }
    return escapeExpression(stack1);}

    buffer += "<a class=\"user-organization organization\" href=\"/";
    foundHelper = helpers.login;
    stack1 = foundHelper || depth0.login;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\" title=\"";
    foundHelper = helpers.login;
    stack1 = foundHelper || depth0.login;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\">\n  <img class=\"avatar\" src=\"";
    foundHelper = helpers.gravatar;
    stack1 = foundHelper || depth0.gravatar;
    tmp1 = self.program(1, program1, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "\" />\n</a>\n";
    return buffer;});
}});

window.require.define({"views/templates/user_organizations": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var foundHelper, self=this;


    return "<h4>Organizations</h4>\n<div class=\"users-list\"></div>\n";});
}});

window.require.define({"views/templates/user_page": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var buffer = "", stack1, foundHelper, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression;


    buffer += "<div class=\"user-repo-sync-container\"></div>\n<div class=\"user-organization-list-container user-owner-list-container\"></div>\n<div class=\"user-repo-list-container\">\n  <h4>Repositories <a class=\"icon-github\" href=\"https://github.com/";
    foundHelper = helpers.login;
    stack1 = foundHelper || depth0.login;
    if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
    else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "login", { hash: {} }); }
    buffer += escapeExpression(stack1) + "\" title=\"GitHub\"></a></h4>\n</div>\n";
    return buffer;});
}});

window.require.define({"views/templates/user_repo_sync": function(exports, require, module) {
  module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
    helpers = helpers || Handlebars.helpers;
    var buffer = "", stack1, foundHelper, tmp1, self=this, functionType="function", blockHelperMissing=helpers.blockHelperMissing;

  function program1(depth0,data) {
    
    
    return "\n  <div class=\"user-repo-sync-button-container\">\n    <button class=\"button user-repo-sync-button\">Sync GitHub repos</button>\n  </div>\n";}

    foundHelper = helpers.if_has_sync_repo_permission;
    stack1 = foundHelper || depth0.if_has_sync_repo_permission;
    tmp1 = self.program(1, program1, data);
    tmp1.hash = {};
    tmp1.fn = tmp1;
    tmp1.inverse = self.noop;
    if(foundHelper && typeof stack1 === functionType) { stack1 = stack1.call(depth0, tmp1); }
    else { stack1 = blockHelperMissing.call(depth0, stack1, tmp1); }
    if(stack1 || stack1 === 0) { buffer += stack1; }
    buffer += "\n\n";
    return buffer;});
}});

window.require.define({"views/topic_page_view": function(exports, require, module) {
  var Collection, NewPostFormView, PageView, Post, PostsView, TopicPageView, template,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  PageView = require('views/base/page_view');

  template = require('views/templates/topic_page');

  Collection = require('models/base/collection');

  Post = require('models/post');

  PostsView = require('views/posts_view');

  NewPostFormView = require('views/new_post_form_view');

  module.exports = TopicPageView = (function(_super) {

    __extends(TopicPageView, _super);

    function TopicPageView() {
      return TopicPageView.__super__.constructor.apply(this, arguments);
    }

    TopicPageView.prototype.template = template;

    TopicPageView.prototype.getNavigationData = function() {
      return {
        gravatar_id: this.model.get('repo').get('user').get('gravatar_id'),
        user_login: this.model.get('repo').get('user').get('login'),
        repo_name: this.model.get('repo').get('name'),
        topic_number: this.model.get('number')
      };
    };

    TopicPageView.prototype.renderSubviews = function() {
      var createNewPost, posts,
        _this = this;
      posts = new Collection(null, {
        model: Post
      });
      posts.url = this.model.url('/posts/');
      this.subview('posts', new PostsView({
        collection: posts,
        container: this.$('.topic-posts-container')
      }));
      posts.fetch();
      this.subscribeEvent('post:new', function(post) {
        return posts.push(post);
      });
      createNewPost = function() {
        var newPost, newPostView;
        newPost = new Post({
          topic: _this.model
        });
        newPostView = new NewPostFormView({
          model: newPost,
          container: _this.$('.new-post-form-container')
        });
        newPostView.on('dispose', function() {
          return setTimeout(createNewPost, 0);
        });
        return _this.subview('newPostForm', newPostView);
      };
      return createNewPost();
    };

    return TopicPageView;

  })(PageView);
  
}});

window.require.define({"views/topic_view": function(exports, require, module) {
  var TopicView, View, template,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  View = require('views/base/view');

  template = require('views/templates/topic');

  module.exports = TopicView = (function(_super) {

    __extends(TopicView, _super);

    function TopicView() {
      return TopicView.__super__.constructor.apply(this, arguments);
    }

    TopicView.prototype.template = template;

    TopicView.prototype.className = 'repo-topic';

    return TopicView;

  })(View);
  
}});

window.require.define({"views/topics_view": function(exports, require, module) {
  var CollectionView, Topic, TopicsView,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  CollectionView = require('views/base/collection_view');

  Topic = require('views/topic_view');

  module.exports = TopicsView = (function(_super) {

    __extends(TopicsView, _super);

    function TopicsView() {
      return TopicsView.__super__.constructor.apply(this, arguments);
    }

    TopicsView.prototype.itemView = Topic;

    return TopicsView;

  })(CollectionView);
  
}});

window.require.define({"views/user_organizations_view": function(exports, require, module) {
  var UserOrganizationsView, UsersView, template,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  UsersView = require('views/users_view');

  template = require('views/templates/user_organizations');

  module.exports = UserOrganizationsView = (function(_super) {

    __extends(UserOrganizationsView, _super);

    function UserOrganizationsView() {
      return UserOrganizationsView.__super__.constructor.apply(this, arguments);
    }

    UserOrganizationsView.prototype.template = template;

    UserOrganizationsView.prototype.listSelector = '.users-list';

    return UserOrganizationsView;

  })(UsersView);
  
}});

window.require.define({"views/user_page_view": function(exports, require, module) {
  var Collection, OrganizationOwnersView, PageView, Repo, ReposView, User, UserOrganizationsView, UserPageView, UserRepoSyncView, UsersView, template,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  PageView = require('views/base/page_view');

  template = require('views/templates/user_page');

  Collection = require('models/base/collection');

  Repo = require('models/repo');

  User = require('models/user');

  ReposView = require('views/repos_view');

  UsersView = require('views/users_view');

  UserOrganizationsView = require('views/user_organizations_view');

  OrganizationOwnersView = require('views/organization_owners_view');

  UserRepoSyncView = require('views/user_repo_sync_view');

  module.exports = UserPageView = (function(_super) {

    __extends(UserPageView, _super);

    function UserPageView() {
      return UserPageView.__super__.constructor.apply(this, arguments);
    }

    UserPageView.prototype.template = template;

    UserPageView.prototype.getNavigationData = function() {
      return {
        gravatar_id: this.model.get('gravatar_id'),
        user_login: this.model.get('login')
      };
    };

    UserPageView.prototype.renderSubviews = function() {
      var organizations, owners, repoSync, repoSyncView, repos,
        _this = this;
      repos = new Collection(null, {
        model: Repo
      });
      repos.url = this.model.url('/repos/');
      this.subview('repos', new ReposView({
        collection: repos,
        container: this.$('.user-repo-list-container')
      }));
      repos.fetch();
      if (this.model.get('type') === 'User') {
        organizations = new Collection(this.model.get('organizations'), {
          model: User
        });
        this.subview('organizations', new UserOrganizationsView({
          collection: organizations,
          container: this.$('.user-organization-list-container')
        }));
      } else {
        owners = new Collection(this.model.get('owners'), {
          model: User
        });
        this.subview('owners', new OrganizationOwnersView({
          collection: owners,
          container: this.$('.user-owner-list-container')
        }));
      }
      repoSync = new Collection(null, {
        model: Repo
      });
      repoSync.url = this.model.url('/sync_repos/');
      repoSync.fetch = function(options) {
        return $.post(repoSync.url);
      };
      repoSyncView = new UserRepoSyncView({
        collection: repoSync,
        container: this.$('.user-repo-sync-container'),
        login: this.model.get('login')
      });
      this.subview('repoSync', repoSyncView);
      return repoSyncView.on('sync', function() {
        return repos.fetch();
      });
    };

    return UserPageView;

  })(PageView);
  
}});

window.require.define({"views/user_repo_sync_view": function(exports, require, module) {
  var UserRepoSyncView, View, template,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  View = require('views/base/view');

  template = require('views/templates/user_repo_sync');

  module.exports = UserRepoSyncView = (function(_super) {

    __extends(UserRepoSyncView, _super);

    function UserRepoSyncView() {
      this.sync = __bind(this.sync, this);
      return UserRepoSyncView.__super__.constructor.apply(this, arguments);
    }

    UserRepoSyncView.prototype.template = template;

    UserRepoSyncView.prototype.className = 'user-repo-sync';

    UserRepoSyncView.prototype.autoRender = true;

    UserRepoSyncView.prototype.initialize = function(args) {
      UserRepoSyncView.__super__.initialize.apply(this, arguments);
      this.login = args.login;
      this.subscribeEvent('loginStatus', this.render);
      return this.delegate('click', '.user-repo-sync-button', this.sync);
    };

    UserRepoSyncView.prototype.getTemplateData = function() {
      var obj;
      obj = UserRepoSyncView.__super__.getTemplateData.apply(this, arguments);
      obj.login = this.login;
      return obj;
    };

    UserRepoSyncView.prototype.sync = function(event) {
      var $button,
        _this = this;
      $button = $(event.currentTarget);
      if ($button.attr('disabled')) {
        return;
      }
      $button.attr('disabled', 'disabled');
      return this.collection.fetch().done(function() {
        $button.removeAttr('disabled');
        return _this.trigger('sync');
      });
    };

    return UserRepoSyncView;

  })(View);
  
}});

window.require.define({"views/user_view": function(exports, require, module) {
  var UserView, View, template,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  View = require('views/base/view');

  template = require('views/templates/user');

  module.exports = UserView = (function(_super) {

    __extends(UserView, _super);

    function UserView() {
      return UserView.__super__.constructor.apply(this, arguments);
    }

    UserView.prototype.template = template;

    UserView.prototype.className = 'user';

    UserView.prototype.tagName = 'span';

    return UserView;

  })(View);
  
}});

window.require.define({"views/users_view": function(exports, require, module) {
  var CollectionView, User, UsersView,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  CollectionView = require('views/base/collection_view');

  User = require('views/user_view');

  module.exports = UsersView = (function(_super) {

    __extends(UsersView, _super);

    function UsersView() {
      return UsersView.__super__.constructor.apply(this, arguments);
    }

    UsersView.prototype.className = 'users';

    UsersView.prototype.getTemplateFunction = function() {
      return this.template;
    };

    UsersView.prototype.itemView = User;

    return UsersView;

  })(CollectionView);
  
}});

